import grpc
import Account_pb2
import Account_pb2_grpc


class AccountClient:

    def __init__(self, target):
        self.channel = grpc.insecure_channel(target)
        self.stub = Account_pb2_grpc.AccountServiceStub(self.channel)
        return

    '''
    通过id查到账户
    '''
    def findOneById(self, id_in):
        id_query = Account_pb2.IdQuery(id=id_in)
        response = self.stub.getOne(id_query)
        return response

    '''
    通过id范围查到账户集合
    '''
    def findAllByRange(self, lower, uppper):
        # todo
        return

    '''
    通过id集合查到账户集合
    '''
    def findAllByIds(self, ids):
        # todo
        return

    '''
    通过id集合获取账号余额总数
    '''
    def getBalanceSumByIds(self, ids):
        # todo
        return
